<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title></title>
    <link rel="stylesheet" href="./css/section.css">
    <script src="../../../../lib/axios.js"></script>
    <!-- <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> -->
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        
        html, body{
            height: 100%;
        }
        ul li{
            list-style: none;
        }
        a{
            text-decoration: none;
            
        }
        a:link{
            color: #404040;
        }
        a:visited{
            color: #404040;
        }
        a:hover{
            color: #404040;
        }
        a:active{
            color: #404040;
        }
        ::-webkit-scrollbar{
            /* width: 0; 移动端取消滚动条无效*/
            display: none;
        }
        body{
            background: #EDEDED;/*#2493f1*/
            display: flex;
            flex-direction: column;
            font-family: 微软雅黑;
            font-size: .3865rem;
            letter-spacing: .0169rem;/*
            position: relative;*/
            overflow: hidden;/*禁止上下滑动*/
            -webkit-user-select:none;
            -moz-user-select:none;
            -ms-user-select:none;
            user-select:none;
        }
        header{
            background-color: #EDEDED !important;
            border-bottom: .0121rem solid rgba(112, 112, 112, 0.24);

        }
        
        section{/*
            border: 1px solid red;*/
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            align-items: center;/*

            position: relative;*/
        }
        
    </style>
    <link rel="stylesheet" href="../../../../css/header.css">
    <!-- 引入样式文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@2.2/lib/index.css" referrerpolicy="no-referrer"/>
    <script src="../../../../lib/vue.js"></script>
    
</head>
<body>
    <header>
        <div class="backBtn"></div>
        <div class="left"></div>
        <span class="title"></span>
        <div class="right"></div>
        <style>
            header .title{
                font-weight: 400;
            }
            header .right{
                width: 1.1rem;
                height: 1.1rem;
                box-sizing: border-box;
                background-image: url(../../../../images/header/more.webp);
                background-size: .628rem .628rem;
                background-position: center;
                background-repeat: no-repeat;
                position: absolute;
                bottom: 0;
                right: 0;
            }
        </style>
    </header>
    <script>
        document.querySelector(".backBtn").onclick=function(){
            window.history.go(-1)
        }
        document.querySelector("header .right").onclick=function(){
            //window.history.go(-1)

        }
    </script>
    <section>
         <div class="box">
            <ul class="chatUl">
                <li v-for="(item, index) of messageList" :class="(item.from == userid) ? 'right' : 'left'">
                    <span class="time" v-if="isShowTime(item.time, index)">{{item.time | handleTime}}</span>
                    <div>
                        <div v-show="item.from == userid ? false : true" class="others" :style="userIMG !== '' ? {'background': `url(${userIMG}) no-repeat`} : {'background': `url(../../../../images/person/person_senter/defaultUserImg.webp) no-repeat`}"></div>
                        <template>
                            <van-loading  v-show="false"/>
                        </template>
                        <div style="position: relative;">{{item.Content}}<span v-if="isShowRead(item.from, index)" class="read">{{item.read ? "已读" : "已送达"}}</span></div>
                        <!-- <span v-if="isShowRead(item.from, index)" class="read">{{"已送达"}}</span> -->
                        <div v-show="item.from == userid ? true : false" class="me" :style="userimg !== '' ? {'background': `url(${userimg}) no-repeat`} : {'background': `url(../../../../images/person/person_senter/defaultUserImg.webp) no-repeat`}"></div>
                    </div>
                    
                </li>
                
            </ul>
         </div>  
         
        

        <div class="nav">
            <div class="speech"></div>
            <input type="text" @input="checkInput()" v-model="userMsg"  name="" id="" placeholder="">
            <div class="emoji"></div>
            <div class="add"></div>
        </div>




            






        

        
    </section>


    

    
    
    
    
    <script src="https://cdn.jsdelivr.net/npm/vant@2.2/lib/vant.min.js" referrerpolicy="no-referrer"></script>
    <script src="./js/main.js"></script>
    <script>
        let input = document.querySelector('.nav input');
            input.addEventListener('keyup', function(event) {
                if (event.keyCode === 13) {
                    vm.send()
                }
            });
    </script>
    <script>
        //根据设备宽度计算html的font-size
        function resetHtmlFont(){
            //获取html对象并动态设置font-size = 设备宽度的1/10
            document.documentElement.style.fontSize = screen.width/10 + 'px';
        }
        //执行一下
        resetHtmlFont();
        //如果窗口大小改变了，则重新计算基础font-size
        window.onresize = resetHtmlFont;
    </script>
</body>
</html>